//go:build prod
// +build prod

package application

import (
	"github.com/energye/energy/v2/cef"
	"github.com/energye/energy/v2/common"
	"webpage-craw/assets"
)

func assetsLoad(app *cef.TCEFApplication) {
	if !common.IsDarwin() {
		// 有 helper 进程时不能指定 BrowserSubprocessPath
		sub := "helper"
		if common.IsWindows() {
			sub += ".exe"
		}
		application.SetBrowserSubprocessPath(sub)
	}
	cef.BrowserWindow.Config.LocalResource(cef.LocalLoadConfig{
		ResRootDir: "resources",
		FS:         assets.Assets(),
	}.Build())
}
